|
|
|
| TABLE 2.1.CONTINUED | | Control | Name | Caption | | Command Button | cmdMove | Move | | Command Button | cmdCopy | Copy | | Command Button | cmdTargetFile | Browse | | Command Button | cmdSourceFile | Browse | | Label | lblSourceFile | Source File: | | Label | lblTargetFile | Destination File: |
|
|
|
|
|
|
Listing 2.2 shows the final code. Copy it into the frmDialog form's code window; then try running the application and then copying or moving a file. |
|
|
|
|
|
|
|
|
LISTING 2.2. FILEOPENCOPY.BASCOMMAND-BUTTON PROCESSING ROUTINES. |
|
|
|
 |
|
|
|
|
1: Private Sub cmdClose_Click()
2: End
3: End Sub
4:
5: Private Sub cmdCopy_Click()
6: Call FileProcess (ActionCopy)
7: End Sub
8:
9: Private Sub cmdMove_Click()
10: Call FileProcess (ActionMove)
11: End Sub
12:
13: Private Sub cmdSourceFile_Click()
14: dlgFileSelect.Flags = cdlOFNFileMustExist
15: dlgFileSelect.ShowOpen
16: txtSourceFile.Text = dlgFileSelect.filename
17:
18: End Sub
19:
20: Private Sub cmdTargetFile_Click()
21: dlgFileSelect.Flags = cdlOFNOverwritePrompt
22: dlgFileSelect.ShowSave
23: txtTargetFile.Text = dlgFileSelect.filename
24: End Sub
25:
26: Private Sub Form_Load()
27: Load frmStatus
28: End Sub |
|
|
|
|
|